package com.perceptivesoftware.licensing.client.dto;

import com.google.gwt.user.client.rpc.IsSerializable;
import com.perceptivesoftware.licensing.client.common.util.PerceptivePermission;
import com.perceptivesoftware.licensing.client.common.util.PerceptivePermissions;

/**
 * A Data Transfer Object that will encapsulate the Hibernate object KwUserval
 * 
 * <p/>
 * Copyright 2012 Perceptive Software
 * <p/>
 * Confidential and Proprietary
 * <p/>
 * Project: Perceptive Licensing
 * 
 */
public class UserInitialDTO implements IsSerializable {

	private UserDTO userDTO;
	private String uSessionID;
	private PerceptivePermissions percPermissions;
	// private List<UserRoleDTO> allRolesForUsersDepartment;
	private Long timeoutMins;
	// private List<WorkspaceVersionDTO> workspaceVersionList;
	private String errorMessage;

	private String version;

	@SuppressWarnings("unused")
	private UserInitialDTO() {
		//
	}

	public UserInitialDTO(final UserDTO userDTO) {
		setUserDTO(userDTO);
	}

	public void setUSessionID(final String uSessionID) {
		this.uSessionID = uSessionID;
	}

	public String getUSessionID() {
		return uSessionID;
	}

	public PerceptivePermissions getPerceptivePermissions() {
		return percPermissions;
	}

	public void setPerceptivePermissions(final PerceptivePermissions percPermissions) {
		this.percPermissions = percPermissions;
	}

	public boolean hasPermission(final PerceptivePermission np) {
		return percPermissions.hasPermission(np);
	}

	public void setUserDTO(final UserDTO userDTO) {
		this.userDTO = userDTO;
	}

	public UserDTO getUserDTO() {
		return userDTO;
	}

	public Long getTimeoutMins() {
		return timeoutMins;
	}

	public void setTimeoutMins(final Long timeoutMins) {
		this.timeoutMins = timeoutMins;
	}

	public void setErrorMessage(String errorMessage) {
		this.errorMessage = errorMessage;
	}

	public String getErrorMessage() {
		return errorMessage;
	}

	public String getVersionInformation() {
		return version;
	}

	public void setVersionInformation(String v) {
		version = v;
	}

	// public List<WorkspaceVersionDTO> getWorkspaceVersionList()
	// {
	// return workspaceVersionList;
	// }
	//
	// public void setWorkspaceVersionList(final List<WorkspaceVersionDTO>
	// workspaceVersionList)
	// {
	// this.workspaceVersionList = workspaceVersionList;
	// }
}
